package classes
{
	import classes.event.ConsoleEvent;
	import classes.tfo.PostResponseTO;
	
	import flash.net.NetConnection;
	import flash.net.Responder;
	
	public class ConsoleServiceInteracter extends BasedServiceInteracter
	{
		private var postResponder:Responder;
		
		public function ConsoleServiceInteracter(_nc:NetConnection) 
		{
			super(_nc);
			postResponder = new Responder(handlePostResponder, statusResult);
		}
		
		public function post(cmd:String):void {
			getNetConnector().call("console.post", postResponder, cmd);
		}
		
		private function handlePostResponder(item:PostResponseTO):void {
			dispatchEvent(new ConsoleEvent(ConsoleEvent.EXEC, item));
		}

	}
}